home *** CD-ROM | disk | FTP | other *** search
/ DarkBASIC - The Ultimate 3D Game Creator / PCactive 8 CD1 - DarkBasic.iso / SOFTWARE / DEMOS / DarkForge2000 / snippets_vol1 / snip_lazer.dba < prev    next >
Encoding:
Text File  |  2000-08-05  |  848 b   |  54 lines

  1. `    ------------------------------------------------------------------------
  2. `    Lazer Beam                                  DarkForge Snippet (6/8/2000)
  3. `    ------------------------------------------------------------------------
  4. `
  5. `    Strange results happen when you stretch spheres!
  6.  
  7. sync rate 0
  8. sync on
  9. hide mouse
  10.  
  11. load image "lazerblast.bmp",1
  12.  
  13. x=1 : y=1 : z=50
  14.  
  15. for a=1 to 6
  16.     make object sphere a,50
  17.     texture object a,1
  18.     scale object a,x,y,z
  19.     position object a,6*a,20,-15
  20.     point object a,20,30,20
  21. next a
  22.  
  23. position camera 20,30,1
  24.  
  25. color backdrop rgb(0,0,0)
  26. set ambient light 100
  27.  
  28. ` Move!
  29.  
  30. step#=0.50
  31.  
  32. do
  33.  
  34.     for a=1 to 6
  35.         move object a,step#
  36.     next a
  37.  
  38.     z=object position z(1)
  39.     if z=50 then Repoint()
  40.  
  41.     sync
  42.  
  43. loop
  44.  
  45. function Repoint
  46.  
  47.     for x=1 to 6
  48.         position object x,x*6,20,-15
  49.     next x
  50.  
  51. endfunction
  52.  
  53.  
  54.